money = 500


def balance(show_header):
    """
    查询余额
    :return:
    """
    if show_header:
        print('💴💴💴查询余额💴💴💴')
    print(F'{name}，您好！您的余额是{money}')


def save(save_money):
    """
    存款
    :param save_money: 存款金额
    """
    print('💴💴💴存款💴💴💴')

    global money
    money += save_money
    print(F'{name}，您好！您存款{save_money}元成功')
    balance(False)


def withdraw(withdraw_money):
    """
    取款
    :param withdraw_money: 取款金额
    :return:
    """
    print('💴💴💴取款💴💴💴')

    global money
    if money < withdraw_money:
        print('余额不足')
    else:
        money -= withdraw_money
        print(F'{name}，您好！您取款{withdraw_money}元成功')
        balance(False)


def main_menu():
    print(F'👏{name}，您好！欢迎来到未来明天银行ATM。请选择操作👇')
    print('查询余额\t[输入1]')
    print('存款\t\t[输入2]')
    print('取款\t\t[输入3]')
    print('退出\t\t[输入4]')
    return input('请输入您的选择：')


name = input('请输入您的姓名：')
while True:
    choice = main_menu()
    if choice == '1':
        balance(True)
        continue
    elif choice == '2':
        save(int(input('输入存款金额：')))
        continue
    elif choice == '3':
        withdraw(int(input('输入取款金额：')))
        continue
    else:
        print('欢迎下次光临哦')
        break
